#include <stm8s_tim4.h>

void TIM4_PrescalerConfig(TIM4_Prescaler_TypeDef Prescaler, TIM4_PSCReloadMode_TypeDef TIM4_PSCReloadMode)
{
  /* Check the parameters */
  assert_param(IS_TIM4_PRESCALER_RELOAD_OK(TIM4_PSCReloadMode));
  assert_param(IS_TIM4_PRESCALER_OK(Prescaler));
  
  /* Set the Prescaler value */
  TIM4->PSCR = (uint8_t)Prescaler;
  
  /* Set or reset the UG Bit */
  TIM4->EGR = (uint8_t)TIM4_PSCReloadMode;
}

/**
  * @brief  Enables or disables TIM4 peripheral Preload register on ARR.
  * @param   NewState new state of the TIM4 peripheral Preload register.
  * This parameter can be ENABLE or DISABLE.
  * @retval None
  */
